<template>
  <div class="goods-item">
    <img :src="goodsItem.show.img"
         alt="">
    <div class="goods-info">
      <p>{{goodsItem.title}}</p>
      <span class="price">{{goodsItem.price}}</span>
      <span class="collect">☆ {{goodsItem.cfav}}</span>
    </div>
  </div>
</template>

<script>
export default {
  name: 'GoodsItem',
  props: {
    goodsItem: {
      type: Object,
      default () {
        return {};
      }
    }
  }
}
</script>

<style lang="less" scoped>
.goods-item {
  width: 46%;

  img {
    width: 100%;
    height: 87%;
    border-radius: 5px;
    padding: 5px 0;
  }

  .goods-info {
    font-size: 12px;
    text-align: center;

    p {
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
      margin-bottom: 5px;
    }

    .price {
      color: var(--color-high-text);
      margin-right: 20px;
    }
  }
}
</style>